package model

// APP详情信息，所有的路由都是基于APP进行发布的
type AppInfo struct {
	Id            uint   `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement;not null" form:"id" json:"id"`
	RouterFix     string `gorm:"column:router_fix;type:varchar(50);comment:路由前缀" form:"router_fix" json:"router_fix"`                //路由前缀
	Name          string `gorm:"column:name;type:varchar(200);comment:APP名称" form:"name" json:"name"`                                //APP名称
	Info          string `gorm:"column:info;type:text;comment:APP简介" form:"info" json:"info"`                                        //APP简介
	RouterTimeout uint   `gorm:"column:router_timeout;type:int unsigned;comment:路由超时时间" form:"router_timeout" json:"router_timeout"` //路由超时时间
	KeepTimeout   uint   `gorm:"column:keep_timeout;type:int unsigned;comment:长连接超时时间" form:"keep_timeout" json:"keep_timeout"`      //长连接超时时间
	TlsOut        int    `gorm:"column:tls_out;type:int;comment:TLS握手超时时间" form:"tls_out" json:"tls_out"`                            //TLS握手超时时间
	Autos         uint8  `gorm:"column:autos;type:tinyint unsigned;comment:登录认证方式 0-无认证 1-JWT认证" form:"autos" json:"autos"`          //登录认证方式 0-无认证 1-JWT认证
	AutosJwtUid   string `gorm:"column:autos_jwtUid;type:varchar(100);comment:JWT中存放ID的键名" form:"autos_jwtUid" json:"autos_jwtUid"`  //JWT中存放ID的键名
	Keys          uint8  `gorm:"column:keys;type:tinyint unsigned;comment:是否启用KEY认证" form:"keys" json:"keys"`                        //是否启用KEY认证
	CreatedAt     string `gorm:"column:created_at;type:datetime" form:"created_at" json:"created_at"`
	UpdatedAt     string `gorm:"column:updated_at;type:datetime" form:"updated_at" json:"updated_at"`
}

// 返回所属表名信息
func (c *AppInfo) TableName() string {
	return "app_info"
}
